package service

import (
	"video-srvice/basic/config"
	"video-srvice/models"

	"context"

	__ "video-srvice/basic/proto"
)

type Server struct {
	__.UnimplementedVideoServer
}

// SayHello implements helloworld.GreeterServer
func (s *Server) VideoUpload(_ context.Context, in *__.VideoUploadReq) (*__.VideoUploadResp, error) {
	var video models.Video

	if err := video.VideoUp(config.DB); err != nil {
		return nil, err
	}
	return &__.VideoUploadResp{
		Id: int64(video.ID),
	}, nil
}
